﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 计算器{
    static class Program{
        public class CalInfo
        {
            public string m_tag;
            public Func<float, float, float> m_func;//自带的方法
            public CalInfo(string tag, Func<float, float, float> func)
            {
                m_tag = tag;
                m_func = func;
            }
        }
        static CalInfo[] configs = new CalInfo[]{
                new CalInfo("+",(a,b)=> a + b),
                new CalInfo("-",(a,b)=> a - b),
                new CalInfo("*",(a,b)=> a * b),
                new CalInfo("/",(a,b)=> a / b),
            };
        private static void CalcOneLine(string inputStr){
            int index = 1;
            Func<float, float, float> func = null;
            for(int i = 0 ; i < configs.Length ; ++i){
                var item = configs[i];
                index = inputStr.IndexOf(item.m_tag);//符号
                if(index != -1){
                    func = item.m_func;
                    break;
                }
            }
            if (index == -1){
                return;
            }
        }
        [STAThread]
        static void Main(){
            

        }
    }
}
